﻿namespace Pub.Class
{
    using System;

    public class TaskTimer
    {
        private static object lockHelper = new object();
        protected static Timer task = null;

        public static Timer Instance()
        {
            return Instance(false);
        }

        public static Timer Instance(bool useThread)
        {
            if (task.IsNull())
            {
                lock (lockHelper)
                {
                    if (task.IsNull())
                    {
                        task = new Timer(useThread);
                    }
                }
            }
            return task;
        }
    }
}

